﻿@{;
  ViewBag.Title = "表单页面";
  Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = request('keyValue');
    var customerId = request('customerId');
    $(function () {
        initControl();
    });
    //初始化控件
    function initControl() {
        //性别
        $("#F_Gender").ComboBox({
            description: "==请选择==",
        });
        //获取表单
        if (!!keyValue) {
            $.SetForm({
                url: "../../CustomerManage/Customer/GetContactFormJson",
                param: { keyValue: keyValue },
                success: function (data) {
                    $("#form1").SetWebControls(data);
                }
            })
        }
    }
    //保存表单;
    function AcceptClick() {
        if (!$('#form1').Validform()) {
            return false;
        }
        var postData = $("#form1").GetWebControls(keyValue);
        postData["F_CustomerId"] = customerId;
        $.SaveForm({
            url: "../../CustomerManage/Customer/SaveContactForm?keyValue=" + keyValue,
            param: postData,
            loading: "正在保存数据...",
            success: function () {
                top.ContactIndex.$("#gridTable").trigger("reloadGrid");
            }
        })
    }
</script>
<div style="margin-top: 20px; margin-right: 30px;">
    <table class="form">
        <tr>
            <td class="formTitle">联系人<font face="宋体">*</font></td>
            <td class="formValue">
                <input id="F_Contact" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
            </td>
            <td class="formTitle">性别</td>
            <td class="formValue">
                <div id="F_Gender" type="select" class="ui-select">
                    <ul>
                        <li data-value="1">男</li>
                        <li data-value="0">女</li>
                    </ul>
                </div>
            </td>
        </tr>
        <tr>
            <td class="formTitle">手机</td>
            <td class="formValue">
                <input id="F_Mobile" type="text" class="form-control" />
            </td>
            <td class="formTitle">电话</td>
            <td class="formValue">
                <input id="F_Tel" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">传真</td>
            <td class="formValue">
                <input id="F_Fax" type="text" class="form-control" />
            </td>
            <td class="formTitle">邮箱</td>
            <td class="formValue">
                <input id="F_Email" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">QQ</td>
            <td class="formValue">
                <input id="F_QQ" type="text" class="form-control" />
            </td>
            <td class="formTitle">微信</td>
            <td class="formValue">
                <input id="F_Wechat" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">职位</td>
            <td class="formValue">
                <input id="F_PostId" type="text" class="form-control" />
            </td>
            <td class="formTitle">爱好</td>
            <td class="formValue">
                <input id="F_Hobby" type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">备注</td>
            <td class="formValue" colspan="3">
                <input id="F_Description" type="text" class="form-control" />
            </td>
        </tr>
    </table>
</div>
